package com.flashphoner.api.management
{
	import com.flashphoner.api.data.PhoneConfig;
	
	import flash.media.Camera;
	
	public class VideoControl
	{
		private static var videoControl:VideoControl;
		private var cam:Camera;
		
		public function VideoControl()
		{
			if (PhoneConfig.VIDEO_ENABLED){
				cam = Camera.getCamera();
				cam.setMode(176,144,15,true);
				cam.setKeyFrameInterval(48);
				cam.setQuality(0,95);
				cam.setMotionLevel(50,2000);
			}			
		}
		
		public static function getInstance():VideoControl{
			if (videoControl == null){
				videoControl = new VideoControl();
			}
			return videoControl;
		}
		
		public function getCam():Camera{
			return cam;
		}
		public function changeCamera(camera:Camera):void{
			if (PhoneConfig.VIDEO_ENABLED){
				camera.setMode(176,144,15,true);
				camera.setKeyFrameInterval(12);
				camera.setQuality(0,80);
				camera.setMotionLevel(50,2000);
				this.cam = camera;					
			}
		}		

	}
}